<!DOCTYPE html >
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <th:block th:insert="pages/developer/common/head::head"></th:block>
</head>
<body class="nav-md footer_fixed">
<div class="container body">
    <div class="main_container">
        <!-- left -->
        <th:block th:insert="pages/developer/common/head::left"></th:block>
        <!-- top -->
        <th:block th:insert="pages/developer/common/head::top"></th:block>
        <!--right -->
        <div class="right_col" role="main">
            <div class="clearfix"></div>
            <div class="row">
                <div class="col-md-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2 th:inline="text">
                                APP 信息管理维护 <i class="fa fa-user"></i>
                                <small>[[${session.devUserSession.devName}]] - 您可以通过搜索或者其他的筛选项对APP的信息进行修改、删除等管理操作。^_^</small>
                            </h2>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">
                            <form method="post" action="list">
                                <input type="hidden" name="pageIndex" value="1"/>
                                <ul>
                                    <li>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">软件名称</label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input name="querySoftwareName" type="text"
                                                       class="form-control col-md-7 col-xs-12"
                                                       th:value="${querySoftwareName }">
                                            </div>
                                        </div>
                                    </li>

                                    <li>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">APP状态</label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <select name="queryStatus" class="form-control">
                                                    <th:block th:if="${statusList != null}">
                                                        <option value="">--请选择--</option>
                                                        <th:block th:each="dataDictionary:${statusList}">
                                                            <option
                                                                    th:if="${dataDictionary.valueId == queryStatus}"
                                                                    selected="selected"
                                                                    th:value="${dataDictionary.valueId}"
                                                                    th:inline="text">[[${dataDictionary.valueName}]]
                                                            </option>
                                                            <option
                                                                    th:if="${dataDictionary.valueId != queryStatus}"
                                                                    th:value="${dataDictionary.valueId}"
                                                                    th:inline="text">[[${dataDictionary.valueName}]]
                                                            </option>
                                                        </th:block>
                                                    </th:block>
                                                </select>
                                            </div>
                                        </div>
                                    </li>
                                    <li>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">所属平台</label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <select name="queryFlatformId" class="form-control">
                                                    <th:block th:if="${flatFormList != null }">
                                                        <option value="">--请选择--</option>
                                                        <th:block th:each="dataDictionary:${flatFormList}">
                                                            <option
                                                                    th:if="${dataDictionary.valueId == queryFlatformId }"
                                                                    selected="selected"
                                                                    th:value="${dataDictionary.valueId}" th:inline="text">
                                                                [[${dataDictionary.valueName}]]
                                                            </option>
                                                            <option
                                                                    th:if="${dataDictionary.valueId != queryFlatformId }"
                                                                    th:value="${dataDictionary.valueId}" th:inline="text">
                                                                [[${dataDictionary.valueName}]]
                                                            </option>
                                                        </th:block>
                                                    </th:block>
                                                </select>
                                            </div>
                                        </div>
                                    </li>
                                    <li>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">一级分类</label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <select id="queryCategoryLevel1" name="queryCategoryLevel1"
                                                        class="form-control">
                                                    <th:block th:if="${categoryLevel1List != null }">
                                                        <option value="">--请选择--</option>
                                                        <th:block th:each="appCategory:${categoryLevel1List}">
                                                            <option
                                                                    th:if="${appCategory.id == queryCategoryLevel1 }"
                                                                    selected="selected"
                                                                    th:value="${appCategory.id}" th:inline="text">
                                                                [[${appCategory.categoryName}]]
                                                            </option>
                                                            <option
                                                                    th:if="${appCategory.id != queryCategoryLevel1 }"
                                                                    th:value="${appCategory.id}" th:inline="text">
                                                                [[${appCategory.categoryName}]]
                                                            </option>
                                                        </th:block>
                                                    </th:block>
                                                </select>
                                            </div>
                                        </div>
                                    </li>
                                    <li>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">二级分类</label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="hidden" name="categorylevel2list" id="categorylevel2list"/>
                                                <select name="queryCategoryLevel2" id="queryCategoryLevel2"
                                                        class="form-control">
                                                    <th:block th:if="${categoryLevel2List != null }">
                                                        <option value="">--请选择--</option>
                                                        <th:block th:each="appCategory:${categoryLevel2List}">
                                                            <option
                                                                    th:if="${appCategory.id == queryCategoryLevel2 }"
                                                                    selected="selected"
                                                                    th:value="${appCategory.id}" th:inline="text">
                                                                [[${appCategory.categoryName}]]
                                                            </option>
                                                            <option
                                                                    th:if="${appCategory.id != queryCategoryLevel2 }"
                                                                    th:value="${appCategory.id}" th:inline="text">
                                                                [[${appCategory.categoryName}]]
                                                            </option>
                                                        </th:block>
                                                    </th:block>
                                                </select>
                                            </div>
                                        </div>
                                    </li>
                                    <li>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12">三级分类</label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <select name="queryCategoryLevel3" id="queryCategoryLevel3"
                                                        class="form-control">
                                                    <th:block th:if="${categoryLevel3List != null }">
                                                        <option value="">--请选择--</option>
                                                        <th:block th:each="appCategory:${categoryLevel3List}">
                                                            <option
                                                                    th:if="${appCategory.id == queryCategoryLevel3 }"
                                                                    selected="selected"
                                                                    th:value="${appCategory.id}" th:inline="text">
                                                                [[${appCategory.categoryName}]]
                                                            </option>
                                                            <option
                                                                    th:if="${appCategory.id != queryCategoryLevel3 }"
                                                                    th:value="${appCategory.id}" th:inline="text">
                                                                [[${appCategory.categoryName}]]
                                                            </option>
                                                        </th:block>
                                                    </th:block>
                                                </select>
                                            </div>
                                        </div>
                                    </li>
                                    <li>
                                        <button type="submit" class="btn btn-primary"> 查 &nbsp;&nbsp;&nbsp;&nbsp;询
                                        </button>
                                    </li>
                                </ul>
                            </form>
                        </div>
                    </div>
                </div>
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_content">
                            <p class="text-muted font-13 m-b-30"></p>
                            <div id="datatable-responsive_wrapper"
                                 class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                                <div class="row">
                                    <div class="col-sm-12">
                                        <a th:href="@{/dev/flatform/app/appinfoadd}" class="btn btn-success btn-sm">新增APP基础信息</a>
                                        <table id="datatable-responsive"
                                               class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
                                               cellspacing="0" width="100%" role="grid"
                                               aria-describedby="datatable-responsive_info" style="width: 100%;">
                                            <thead>
                                            <tr role="row">
                                                <th class="sorting_asc" tabindex="0"
                                                    aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                    aria-label="First name: activate to sort column descending"
                                                    aria-sort="ascending">软件名称
                                                </th>
                                                <th class="sorting" tabindex="0"
                                                    aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                    aria-label="Last name: activate to sort column ascending">
                                                    APK名称
                                                </th>
                                                <th class="sorting" tabindex="0"
                                                    aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                    aria-label="Last name: activate to sort column ascending">
                                                    软件大小(单位:M)
                                                </th>
                                                <th class="sorting" tabindex="0"
                                                    aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                    aria-label="Last name: activate to sort column ascending">
                                                    所属平台
                                                </th>
                                                <th class="sorting" tabindex="0"
                                                    aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                    aria-label="Last name: activate to sort column ascending">
                                                    所属分类(一级分类、二级分类、三级分类)
                                                </th>
                                                <th class="sorting" tabindex="0"
                                                    aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                    aria-label="Last name: activate to sort column ascending">
                                                    状态
                                                </th>
                                                <th class="sorting" tabindex="0"
                                                    aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                    aria-label="Last name: activate to sort column ascending">
                                                    下载次数
                                                </th>
                                                <th class="sorting" tabindex="0"
                                                    aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                    aria-label="Last name: activate to sort column ascending">
                                                    最新版本号
                                                </th>
                                                <th class="sorting" tabindex="0"
                                                    aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                    style="width: 124px;"
                                                    aria-label="Last name: activate to sort column ascending">
                                                    操作
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr th:each="appInfo,status:${appInfoList}" role="row" class="odd">
                                                <td tabindex="0" class="sorting_1" th:inline="text">
                                                    [[${appInfo.softwareName}]]
                                                </td>
                                                <td th:inline="text">[[${appInfo.APKName }]]</td>
                                                <td th:inline="text">[[${appInfo.softwareSize}]]</td>
                                                <td th:inline="text">[[${appInfo.flatformName}]]</td>
                                                <td th:inline="text">[[${appInfo.categoryLevel1Name}]] ->
                                                    [[${appInfo.categoryLevel2Name}]] -> [[${appInfo.categoryLevel3Name}]]
                                                </td>
                                                <td th:inline="text"><span id="appInfoStatus${appInfo.id}">[[${appInfo.statusName}]]</span>
                                                </td>
                                                <td th:inline="text">[[${appInfo.downloads}]]</td>
                                                <td th:inline="text">[[${appInfo.versionNo}]]</td>
                                                <td>


                                                    <div class="btn-group">
                                                        <button type="button" class="btn btn-danger">点击操作</button>
                                                        <button type="button" class="btn btn-danger dropdown-toggle"
                                                                data-toggle="dropdown" aria-expanded="false">
                                                            <span class="caret"></span>
                                                            <span class="sr-only">Toggle Dropdown</span>
                                                        </button>
                                                        <ul class="dropdown-menu" role="menu">
                                                            <li>
                                                                <a th:if="${appInfo.status == 2 || appInfo.status == 5}"
                                                                   class="saleSwichOpen" saleSwitch="open"
                                                                   th:appinfoid="${appInfo.id }"
                                                                   th:appsoftwarename="${appInfo.softwareName }"
                                                                   data-toggle="tooltip" data-placement="top" title=""
                                                                   data-original-title="恭喜您，您的审核已经通过，您可以点击上架发布您的APP">上架</a>
                                                                <a th:if="${appInfo.status == 4}"
                                                                   class="saleSwichClose" saleSwitch="close"
                                                                   th:appinfoid="${appInfo.id }"
                                                                   th:appsoftwarename="${appInfo.softwareName }"
                                                                   data-toggle="tooltip" data-placement="top" title=""
                                                                   data-original-title="您可以点击下架来停止发布您的APP，市场将不提供APP的下载">下架</a>
                                                            </li>
                                                            <li><a class="addVersion" th:appinfoid="${appInfo.id }"
                                                                   data-toggle="tooltip" data-placement="top" title=""
                                                                   data-original-title="新增APP版本信息">新增版本</a>
                                                            </li>
                                                            <li><a class="modifyVersion"
                                                                   th:appinfoid="${appInfo.id }"
                                                                   th:versionid="${appInfo.versionId }"
                                                                   th:status="${appInfo.status }"
                                                                   th:statusname="${appInfo.statusName }"
                                                                   data-toggle="tooltip" data-placement="top" title=""
                                                                   data-original-title="修改APP最新版本信息">修改版本</a>
                                                            </li>
                                                            <li><a class="modifyAppInfo"
                                                                   th:appinfoid="${appInfo.id }"
                                                                   th:status="${appInfo.status }"
                                                                   th:statusname="${appInfo.statusName }"
                                                                   data-toggle="tooltip" data-placement="top" title=""
                                                                   data-original-title="修改APP基础信息">修改</a></li>
                                                            <li><a class="viewApp"
                                                                   th:appinfoid="${appInfo.id }"
                                                                   data-toggle="tooltip" data-placement="top" title=""
                                                                   data-original-title="查看APP基础信息以及全部版本信息">查看</a></li>
                                                            <li><a class="deleteApp"
                                                                   th:appinfoid="${appInfo.id }"
                                                                   th:appsoftwarename="${appInfo.softwareName }"
                                                                   data-toggle="tooltip" data-placement="top" title=""
                                                                   data-original-title="删除APP基础信息以及全部版本信息">删除</a></li>
                                                        </ul>
                                                    </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-5">
                                        <div class="dataTables_info" id="datatable-responsive_info"
                                             role="status" aria-live="polite" th:inline="text">共[[${pages.totalCount }]]条记录
                                            [[${pages.currentPageNo }]]/[[${pages.totalPageCount }]]页
                                        </div>
                                    </div>
                                    <div class="col-sm-7">
                                        <div class="dataTables_paginate paging_simple_numbers"
                                             id="datatable-responsive_paginate">
                                            <ul class="pagination">
                                                <th:block th:if="${pages.currentPageNo > 1}" th:inline="text">
                                                    <li class="paginate_button previous"><a
                                                            href="javascript:page_first(document.forms[0]);"
                                                            aria-controls="datatable-responsive" data-dt-idx="0"
                                                            tabindex="0">首页</a>
                                                    </li>
                                                    <li class="paginate_button"><a th:myself="${pages.currentPageNo - 1}"
                                                                                   href="javascript:page_previous(document.forms[0]);"
                                                                                   aria-controls="datatable-responsive"
                                                                                   data-dt-idx="1"
                                                                                   tabindex="0">上一页</a>
                                                    </li>
                                                </th:block>
                                                <th:block th:if="${pages.currentPageNo < pages.totalPageCount}"
                                                          th:inline="text">
                                                    <li class="paginate_button " th:inline="javascript"><a
                                                            href="javascript:page_next(document.forms[0]);"
                                                            aria-controls="datatable-responsive" data-dt-idx="1"
                                                            tabindex="0">下一页</a>
                                                    </li>
                                                    <li class="paginate_button next"><a th:myself2="${pages.totalPageCount}"
                                                                                        href="javascript:page_last(document.forms[0]);"
                                                                                        aria-controls="datatable-responsive"
                                                                                        data-dt-idx="7"
                                                                                        tabindex="0">最后一页</a>
                                                    </li>
                                                </th:block>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:insert="pages/developer/common/foot::js"></th:block>
</body>
<script type="text/javascript" th:inline="javascript">

    function page_first(frm) {
        frm.pageIndex.value = 1;
        frm.submit();
    }

    function page_next(frm) {
        frm.pageIndex.value = [[${pages.currentPageNo}]] + 1;
        frm.submit();
    }

    function page_previous(frm) {
        frm.pageIndex.value = [[${pages.currentPageNo}]] - 1;
        frm.submit();
    }

    function page_last(frm) {
        frm.pageIndex.value = [[${pages.totalPageCount}]];
        frm.submit();
    }

</script>
<script th:src="@{/localjs/rollpage.js}"></script>
<script th:src="@{/localjs/appinfolist.js}"></script>
</html>